#include "Disk2.h"
#include "Circle2.h"
#include "Allocator.h"
#include <boost/cast.hpp>


/////////////////////////////////////////////////
const Vector2 Disk2::supportPoint(const Vector2& direction) const
{
	Vector2 normal(direction);
	assert(!normal.isZero());
	normal.normalize();
	return (normal * radius_);
}

////////////////////////////////////////////////

IEdge2* Disk2::trim(
	const Vector2&		startNormal,
	const Vector2&		endNormal,
	IStackAllocator&	stack
) const
{
	return stack.create<Arc2>(*this, startNormal, endNormal);
}
/////////////////////////

IEdgeIterator2* Disk2::boundary(IStackAllocator& stack) const
{
	return stack.create<Circle2>(*this);
}

